Closed Bug 1757219 Opened 2 years ago Closed 2 years ago

Scale min font size for subtitles in PiP according to the OS settings

Categories

(Toolkit :: Picture-in-Picture, enhancement, P2)

enhancement
Points:
5

Tracking

()

RESOLVED FIXED
101 Branch
Tracking Status
firefox101 --- fixed

People

(Reporter: asafko, Assigned: niklas)

References

Details

(Whiteboard: [fidefe-MR1-2022])

Attachments

(1 file)

User Story 1
As a user who sets display scaling larger than the default, I want my choice to be respected in the PiP window captions size.

Acceptance Criteria

Windows

  1. PiP captions size is adjusted if a user chooses a larger scale in Settings - Display - Scale and Layout - Scale.
    This already works in Nightly 99 on Win 10.

macOS

  1. PiP captions size is adjusted if a user chooses a larger scale in System Preferences - Display - Scaled Resolution - Large (r) Text.

This already works in Nightly 99 on macOS 11.6.

Linux

  1. PiP captions size is adjusted if a user chooses a larger display/resolutions scale in GUI settings.

Behavior on PiP window resizing

  1. PiP window caption uses the user OS setting as minimum font size and follows the same scaling guidelines on PiP window resizing.

User Story 2
As user, who wants to change their font size in PiP, I want to be able to switch between "small", "medium", and "large" values.

Acceptance Criteria

  1. media.videocontrols.picture-in-picture.display-text-tracks.font-size allows for three values: "small", "medium", and "large".
  2. This pref defaults to medium in all use cases aside from when OS-level settings are set to a large font option.

Not doing:
macOS
PiP captions inherit the font size set in System Preferences - Accessibility - Captions - Large Text.

Windows

  1. PiP captions inherit the size set in Settings > Accessibility > Text size as a min font size.
    We decided to do this even though we normally only respect this setting for UI.

In this scenario, about:config setting for subtitles font size defaults to "large".

Linux

  1. PiP captions inherit the font size set in Activities - Accessibility - Seeing - Large Text.

I can't find a way to make this change just in CSS; I think we'll have to port the font size math to JS before we can do this. The problem is that we need to take the value we're computing to use right now (or a differently scaled version of it rather), which is in units of vh, and multiply that by whatever the current default font size is, in units of px or % or something else like that. And CSS doesn't have a way to multiply a unit by another unit; one side of any multiplication is required to be unitless. So I think we'll need to add a bit of JS that runs on window resize in order to do those unit conversions.

Points: --- → 5
Assignee: nobody → nbaumgardner
Status: NEW → ASSIGNED
Pushed by nbaumgardner@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/2a8c0b5c0596
Add small, medium, and large font sizes for PiP subtitles. r=mhowell
Regressions: 1763434
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 101 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: